package src.com.foreknow.demo3;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import com.sun.xml.internal.ws.model.wsdl.WSDLOutputImpl;
import org.w3c.dom.ls.LSOutput;

import java.util.Scanner;

/**
 *制作一个菜单
 **************************************
 *1.fender     2.gibson     3.yamaha
 **************************************
 *请选择某个商品 1
 *      可以将某个商品设置价格
 *      显示商品的名称和商品的价格
 *      询问用户是否继续（y/n）
 *      直到客户选择 n 循环结束
 *
 */

public class LoopDemo2 {
    public static void main(String[] args) {
        System.out.println("*************************************");
        System.out.println(" 1.fender     2.gibson     3.yamaha ");
        System.out.println("*************************************");
        Scanner input = new Scanner(System.in);
        String name = "";
        double price = 0.0;
        String answer = "y";
        while (answer.equals("y")){
            System.out.println("请选择商品编号:");
            int num = input.nextInt();
            switch (num){
                case 1:
                    name = "fender";
                    price = 12345.56;
                    break;
                case 2:
                    name = "gibson";
                    price = 34561.56;
                    break;
                case 3:
                    name = "yamaha";
                    price = 6789.56;
                    break;
            }
            System.out.println(name + "......" + price);
            System.out.println("是否继续y/n");
            answer = input.next();
        }
        System.out.println("Over.....");

    }
}






















